TARGET = ../../lib/libzrpc.a
OBJPATH = ./
CFLAGS = -Wall -w  -g -ggdb -O0 -Wno-unused -Wno-sign-compare -Wno-deprecated-declarations -Wno-deprecated -Wl,--no-as-needed -std=c++17 -I ./ -I ../

#-fsanitize=leak -fsanitize=address  -fno-omit-frame-pointer 
LFLAGS = -lpthread -lstdc++fs #-lcares
LLIB = 

cppfiles := $(wildcard *.cc ./base/*.cc ./http/*.cc ./net/*.cc ./rpc/*.cc)

OBJS = $(patsubst %.cc,$(OBJPATH)/%.o, $(cppfiles))

$(OBJPATH)/%.o : %.cc
	g++ -c $(CFLAGS) $< -o $@

all : $(TARGET)

$(TARGET) : $(OBJS)
	$(AR) -rcs $(OBJPATH)/$(TARGET) $(OBJS) 

install:
	@mkdir /usr/local/include/network
	@cp *.h /usr/local/include/network
	
clean:
	@rm -rf $(OBJPATH)/*.o
	@rm -rf $(OBJPATH)/net/*.o
	@rm -rf $(OBJPATH)/http/*.o
	@rm -rf $(OBJPATH)/base/*.o
	@rm -rf $(OBJPATH)/rpc/*.o
	@rm -rf $(TARGET)
	
	
	

